<?php

// Show All Car Pictures
echo '<div style="float: left;">';
for($i = 1; $i <= 4; $i++)
{
	echo "<p><a href=\"imagesCookies.php?car=".$i."\">
			<img style=\"width:300px\" src=\"../cars/". $i .".jpg\"/></a></p>";
}
echo "</div>";

if(isset($_GET['car']))
{
	$car = $_GET['car'];
	setcookie("cars", $car);
}


// Show Last Visited Pictures
echo '<div style="float: right;">
		Last Visited Cars:';
if(isset($_GET['car']))
{
	echo "<p><img style=\"width:200px\"  src=\"../cars/". $_GET['car'] .".jpg\"/></a></p>";
}

if(isset($_COOKIE['cars']))
{
	echo "<p><img style=\"width:200px\"  src=\"../cars/". $_COOKIE['cars'] .".jpg\"/></a></p>";
}


echo "</div>";